library(tidyverse)
library(randomForest)

#### Read in data with necessary data for each sample. In this tutorial the column headings must be the same as those used when the model was created.
SHdata <-read.csv('2024 Tutorial samples to use RF model file.csv')


#### Load Soil Protein Full Random Forest Model File:
load("full randomforest model for ACE soil protein 9-10-2023.rda")
#Note the Model File Name in R is RFACE


#### Use AWC Full Random Forest Model to predict AWC on samples of interest.
SHdata$Soilprotein.predict = predict(RFACE, SHdata)



#### Load Soil Protein Reduced Random Forest Model File (Note the reduced RF model has greater prediction error than the full RF model):
load("reduced randomforest model for ACE soil protein 9-10-2023.rda")
#Note the Model File Name in R is RFACE.reduced

#### Use Field Capacity Full Random Forest Model to predict field capacity on samples of interest.
SHdata$Soilprotein.predict.reduced = predict(RFACE.reduced, SHdata)